<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
    <meta name="renderer" content="webkit">
    <!--国产浏览器高速模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="穷在闹市" />
    <!-- 作者 -->
    <meta name="revised" content="穷在闹市.v3, 2019/05/01" />
    <!-- 定义页面的最新版本 -->
    <meta name="description" content="网站简介" />
    <!-- 网站简介 -->
    <meta name="keywords" content="搜索关键字，以半角英文逗号隔开" />
    <title>穷在闹市出品</title>

    <!-- 公共样式 开始 -->
    <link rel="stylesheet" type="text/css" href="/admin/css/base.css">
    <link rel="stylesheet" type="text/css" href="/admin/css/iconfont.css">
    <script type="text/javascript" src="/admin/framework/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/admin/layui/css/layui.css">
    <script type="text/javascript" src="/admin/layui/layui.js"></script>
    <!-- 滚动条插件 -->
    <link rel="stylesheet" type="text/css" href="/admin/css/jquery.mCustomScrollbar.css">
    <script src="/admin/framework/jquery-ui-1.10.4.min.js"></script>
    <script src="/admin/framework/jquery.mousewheel.min.js"></script>
    <script src="/admin/framework/jquery.mCustomScrollbar.min.js"></script>
    <script src="/admin/framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
    <!-- 公共样式 结束 -->


</head>

<body>
<div class="cBody">
    <form class="layui-form" action="" method="get">
        <div class="layui-form-item">
            <div class="layui-input-inline">
                <input type="text" name="search" placeholder="输入用户名称" autocomplete="off" class="layui-input" value="{{$search}}">
            </div>
            <button class="layui-btn" lay-submit lay-filter="formDemo">检索</button>
            <button><a href="/user_refer" class="layui-btn">添加</a></button>
        </div>
    </form>
    <form class="layui-form" action="">

        <table id="customList" class="layui-table">
            <thead>
            <tr>
                <th>用户ID</th>
                <th>用户名称</th>
                <th>用户密码</th>
                <th>联系方式</th>
                <th>用户余额</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($res as $v)
                <tr>
                    <td>{{$v->uid}}</td>
                    <td>{{$v->uname}}</td>
                    <td>{{$v->upassword}}</td>
                    <td>{{$v->utel}}</td>
                    <td>{{$v->wallet}}</td>
                    <td>
                        <a href="/user_delete/?uid={{$v->uid}}" class="layui-btn">删除</a>
                        <a href="/user_alter/?uid={{$v->uid}}" class="layui-btn">修改</a>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </form>

    <!-- layUI 分页模块 -->
    <div id="pages"></div>
    <script>
        layui.use(['laypage', 'layer'], function() {
            var laypage = layui.laypage,
                layer = layui.layer;

            //总页数大于页码总数
            laypage.render({
                elem: 'pages'
                ,limit: {{$m}}
                ,count: {{$count}}
                ,curr: {{$page}}
                ,prev: '上一页'
                ,next: '下一页'
                ,layout: ['count', 'prev', 'page', 'next', 'skip']
                ,jump: function(obj,first){
                    if (!first) {
                        location.href = "/user_index/?" + "page=" + obj.curr+'&&'+'search='+"{{$search}}";
                    }
                }
            });
        });
    </script>

</div>
</body>

</html>
